package cn.tedu.boot032.controller;

import cn.tedu.boot032.entity.Product;
import cn.tedu.boot032.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {
    @Autowired   //自动装配
    ProductMapper mapper;

    @RequestMapping("/insert")
    public String insert(Product product){
        mapper.insert(product);
        return "添加完成!";
    }
}
